package _thread_lock._thread;

/**
 * @Author: huangya
 * @Date: 2019/9/5
 * @Description:
 */
public class Test {

    public static void main(String[] args) throws InterruptedException {
        Thread.sleep(2000);
        Thread thread = new Thread(){
            @Override
            public void run() {
                try {
                    while (true) {
                        Thread.sleep(2000);
                    }
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(1111);
            }
        };
        thread.setDaemon(false);
        thread.start();

//        Thread thread2 = new Thread(){
//            @Override
//            public void run() {
//                try {
//                    Thread.sleep(2000);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//                System.out.println(2222);
//            }
//        };
//        thread2.start();
    }
}
